<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$config = array(
	'login' => array(
		array(
			'field' => 'username',
			'label' => 'Username',
			'rules' => 'required|max_length[32]|xss_clean'
		),
		array(
			'field' => 'password',
			'label' => 'Password',
			'rules' => 'required|max_length[32]|sha1|xss_clean'
		) 
	),
	'add_announcement' => array(
		array(
			'field' => 'title',
			'label' => 'Judul',
			'rules' => 'required|max_length[256]|trim|xss_clean'
		),
		array(
			'field' => 'content',
			'label' => 'Isi',
			'rules' => 'required|xss_clean|trim|prep_for_form'
		)
	),
	'update_story' => array(
		array(
			'field' => 'story',
			'label' => 'Cerita Singkat',
			'rules' => 'required|xss_clean|trim|prep_for_form'
		)
	),
	'add_organization' => array(
		array(
			'field' => 'name',
			'label' => 'Nama Organisasi',
			'rules' => 'required|max_length[64]|trim|xss_clean'
		),
		array(
			'field' => 'year',
			'label' => 'Tahun',
			'rules' => 'required|numeric|exact_length[4]|greater_than[2000]|callback__current_year|xss_clean'
		),
		array(
			'field' => 'position',
			'label' => 'Posisi dan Deskripsi Singkat',
			'rules' => 'required|max_length[256]|trim|xss_clean'
		)
	),
	'add_achievement' => array(
		array(
			'field' => 'name',
			'label' => 'Nama Prestasi',
			'rules' => 'required|max_length[64]|trim|xss_clean'
		),
		array(
			'field' => 'year',
			'label' => 'Tahun',
			'rules' => 'required|numeric|exact_length[4]|greater_than[2000]|callback__current_year|xss_clean'
		),
		array(
			'field' => 'result',
			'label' => 'Hasil dan Deskripsi Singkat',
			'rules' => 'required|max_length[256]|trim|xss_clean'
		)
	),
	'upload_document' => array(
		array(
			'field' => 'id',
			'label' => 'Kategori Berkas',
			'rules' => 'required|xss_clean'
		),
		array(
			'field' => 'details',
			'label' => 'Keterangan',
			'rules' => 'max_length[256]|trim|xss_clean'
		)
	),
	'apply_scholarship' => array(
		array(
			'field' => 'agree',
			'label' => 'Prasyarat',
			'rules' => 'required|xss_clean|callback__agreement_check'
		)
	),
	'add_scholarship' => array(
		array(
			'field' => 'name',
			'label' => 'Nama Beasiswa',
			'rules' => 'required|maxlength[64]|trim|xss_clean'
		),
		array(
			'field' => 'type',
			'label' => 'Tipe',
			'rules' => 'required|trim|xss_clean'
		),
		array(
			'field' => 'sponsor_id',
			'label' => 'Sponsor',
			'rules' => 'required|trim|xss_clean'
		),
		array(
			'field' => 'details',
			'label' => 'Keterangan',
			'rules' => 'required|maxlength[256]|trim|xss_clean'
		),
		array(
			'field' => 'periodstart',
			'label' => 'Awal Periode',
			'rules' => 'required|exact_length[10]|trim|xss_clean|callback__validate_period_start'
		),
		array(
			'field' => 'periodend',
			'label' => 'Akhir Periode',
			'rules' => 'required|exact_length[10]|trim|xss_clean|callback__validate_period_end'
		),
		array(
			'field' => 'deadline',
			'label' => 'Batas Pendaftaran',
			'rules' => 'required|exact_length[10]|trim|xss_clean|callback__validate_deadline'
		),
		array(
			'field' => 'addfiles[]',
			'label' => 'Berkas Tambahan',
			'rules' => 'max_length[64]|trim|xss_clean'
		),
		array(
			'field' => 'requiredfiles[]',
			'label' => 'Berkas Dibutuhkan',
			'rules' => 'xss_clean'
		)
	),
	'edit_sponsor_profile' => array(
		array(
			'field' => 'name',
			'label' => 'Nama',
			'rules' => 'required|maxlength[64]|trim|xss_clean'
		),
		array(
			'field' => 'address',
			'label' => 'Alamat',
			'rules' => 'required|maxlength[256]|trim|xss_clean'
		),
		array(
			'field' => 'contactName',
			'label' => 'Nama Kontak',
			'rules' => 'required|maxlength[64]|trim|xss_clean'
		),
		array(
			'field' => 'contactNo',
			'label' => 'Nomor Kontak',
			'rules' => 'required|maxlength[32]|trim|xss_clean'
		)
	),
	'add_sponsor_profile' => array(
		array(
			'field' => 'name',
			'label' => 'Nama',
			'rules' => 'required|maxlength[64]|trim|xss_clean'
		),
		array(
			'field' => 'address',
			'label' => 'Alamat',
			'rules' => 'required|maxlength[256]|trim|xss_clean'
		),
		array(
			'field' => 'contactName',
			'label' => 'Nama Kontak',
			'rules' => 'required|maxlength[64]|trim|xss_clean'
		),
		array(
			'field' => 'contactNo',
			'label' => 'Nomor Kontak',
			'rules' => 'required|maxlength[32]|trim|xss_clean'
		),
		array(
			'field' => 'user',
			'label' => 'Nama Pengguna',
			'rules' => 'required|maxlength[64]|trim|xss_clean'
		),
		array(
			'field' => 'username',
			'label' => 'Username',
			'rules' => 'required|maxlength[32]|trim|xss_clean'
		),
		array(
			'field' => 'password',
			'label' => 'Password',
			'rules' => 'required|maxlength[32]|sha1|xss_clean'
		),
		array(
			'field' => 'confirm',
			'label' => 'Konfirmasi Password',
			'rules' => 'required|maxlength[32]|matches[password]|sha1|xss_clean'
		)
	),
	'change_password' => array(
		array(
			'field' => 'old',
			'label' => 'Password Lama',
			'rules' => 'required|maxlength[32]|sha1|xss_clean|callback__check_password'
		),
		array(
			'field' => 'new',
			'label' => 'Password Baru',
			'rules' => 'required|maxlength[32]|sha1|xss_clean'
		),
		array(
			'field' => 'confirm',
			'label' => 'Konfirmasi Password Baru',
			'rules' => 'required|maxlength[32]|matches[new]|sha1|xss_clean'
		)
	),
	'generate_report' => array(
		array(
			'field' => 'id',
			'label' => 'Kategori',
			'rules' => 'required|xss_clean'
		),
		array(
			'field' => 'end',
			'label' => 'Tahun Periode',
			'rules' => 'xss_clean|callback__check_category'
		),
		array(
			'field' => 'start',
			'label' => 'Tahun Periode',
			'rules' => 'xss_clean'
		)
	)
);